﻿<?php
  @header("content-Type: text/html; charset=utf-8"); //语言强制
	require_once('head.php');
	$specialCode = urldecode($_GET['specialCode']);
  if (empty($specialCode)){
  	$specialCode = '60';
  }
?>

<link rel="stylesheet" href="/css/list.css" type="text/css"/>
<link rel="stylesheet" href="/css/common.css" type="text/css"/>

<input type="hidden" id="specialCode" value="<?php echo $specialCode; ?>"/>

<script type="text/javascript">
	$(document).ready(function(){
		$("a").each(function(){
			$(this).click(function(){
				$(this).css("font-size","larger");
				$(this).css("background-color","red");
			})
		})
	});
</script>		  

<div class="gblb">
  <div class="hang1">
    <img src="/images/listPrefix.gif"><a id="innerNav60" href="http://www.gudahu.com/stockList.php?specialCode=60" target="_self">上证</a>
    <img src="/images/listPrefix.gif"><a id="innerNav000" href="http://www.gudahu.com/stockList.php?specialCode=000" target="_self">深证主板</a>
    <img src="/images/listPrefix.gif"><a id="innerNav002" href="http://www.gudahu.com/stockList.php?specialCode=002" target="_self">深证中小板</a>
    <img src="/images/listPrefix.gif"><a id="innerNav30" href="http://www.gudahu.com/stockList.php?specialCode=30" target="_self">深证创业板</a> 
  </div>

<div class="hang2"><ul>  
<?php
  // Connect to the database 
  $dbc = mysqli_connect('localhost', 'root', 'k00l@1D;', 'gudahu')
    or die('Error connecting to MySQL server.');
	mysqli_set_charset($dbc, 'utf8');
  // Retrieve the score data from MySQL
  
  $query = "SELECT * FROM stock where code like '".$specialCode."%'";
  $result = mysqli_query($dbc, $query)
    or die('Error querying database.');
  $seq = 0;  
  while ($row = mysqli_fetch_array($result)) { 
      echo '<li><a target="_blank" href="http://www.gudahu.com/'.$row['code'].'.html">'.$row['name'].'('.$row['code'].')</a></li>';
      $seq ++;
      if ($seq % 5 == 0) {
         echo '</ul></div><div class="hang2"><ul>'; 
      }
  }					    
  mysqli_close($dbc);
?>
</ul></div>
   
</div>

<?php
	require_once('foot.php');
?>  